<template>
  <div class="shopcart">
    <Navbar class="cart_navbar">
      <div slot="nav_center">购物车</div>
    </Navbar>
    <Scroll class="cart_wrapper" ref="cart_scroll">
      <div class="cart_content">        
        <Cart_goodslist @Cimgload="Cimgload"></Cart_goodslist>
      </div>
    </Scroll>
  </div>
</template>

<script>
import Cart_bottombar from "./cartComps/Cart_bottombar"
import Cart_goodslist from "./cartComps/Cart_goodslist"
import Scroll from "components/common/scroll/Scroll"
import Navbar from "components/common/navbar/Navbar"


export default {
  name: "Shopcart",
  data(){
    return{
      cart_scroll: null,
    }
  },
  components: {
    Cart_goodslist,
    Cart_bottombar, 
    Scroll,
    Navbar,
    
  },

  methods: {
    Cimgload(){
      if(this.cart_scroll){
        this.cart_scroll.refresh();
        // console.log("test");
      }
    }
  },

  activated() {
    this.cart_scroll.refresh();
  },
  
  mounted(){
    this.cart_scroll = this.$refs.cart_scroll.scroll;
    // console.log(this.cart_scroll);
  }
}
</script>

<style scoped>
  .cart_wrapper{
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 79px;
    overflow: hidden;
  }

  .cart_navbar{
    background-color: #ff8198;
  }

  
  
</style>